$('.classify-nav li').click(function(){
	$(this).addClass('active').siblings('li').removeClass('active');
	var index = $(this).index()
})
var classify = new Vue({
	el: "#app",
	data:{
		s5,
		store:'',
		isStore:-1,// 0为默认选择第一个，-1为不选择
		storeList:'',
	},
	//计算属性
	computed: {},
	//监听属性
	watch: {},
	//钩子函数
	created() {},
	mounted() {
		this.getStore()
		this.getStoreList()
	},
	methods: {
		getStore(){
			var that = this
			s5.initData({url:'/store-cate',type:'post'},(res)=>{
				var data = JSON.parse(res)
				that.store = data.data.list
			})
		},
		getStoreList(){
			var that = this
			setTimeout(()=>{
				var lng = localStorage.getItem("lng")
				var lat = localStorage.getItem("lat")
				s5.initData({url:'/store',type:'post',data:{lat:lat,lng:lng}},(res)=>{
					var data = JSON.parse(res)
					that.storeList = data.data
				})
			},500)
			
		},
		IsActive(index,id){
			this.isStore = index
			var that = this
			setTimeout(()=>{
				var lng = localStorage.getItem("lng")
				var lat = localStorage.getItem("lat")
				s5.initData({url:'/store',type:'post',data:{lat:lat,lng:lng,cate_id:id}},(res)=>{
					var data = JSON.parse(res)
					that.storeList = data.data
				})
			},500)
		},
		toGoodsDetail(id){
			window.location.href = "store-detail.html?id="+id
		}
	}
})